package com.example.a2209_shop.detail

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import com.alibaba.android.arouter.facade.annotation.Autowired
import com.alibaba.android.arouter.facade.annotation.Route
import com.alibaba.android.arouter.launcher.ARouter
import com.example.a2209_shop.R
import com.example.a2209_shop.databinding.ActivityDetaBinding
import com.example.base.entity.DetailEntity
import com.example.base.mvvm.BaseActivity
/**
 * 特意练习ARouter传参 使用
 */
@Route(path = "/app/deta")
class DetaActivity : BaseActivity<ActivityDetaBinding,DetailViewModel>() {
    @Autowired
    @JvmField
    var goods_id = 0

    override fun initData() {

    }

    override fun initView() {
        ARouter.getInstance().inject(this)
        viewModel.detail(goods_id)
        viewModel.detailSuccess.observe(this){
            binding.info = it.data
        }
    }

    override fun getViewModel(): Class<DetailViewModel>  = DetailViewModel::class.java

    override fun getLayout(): Int = R.layout.activity_deta

}